package org.syncsoft.overalt.gui.api.tableDataModel;

import javax.swing.table.DefaultTableModel;

/**
 * 
 * @author tptfc
 *
 */
@SuppressWarnings("serial")
public class AbstractTableDataModel extends DefaultTableModel {
	/*
	 * (non-Javadoc)
	 * @see javax.swing.table.DefaultTableModel#isCellEditable(int, int)
	 */
	@Override
	public boolean isCellEditable(int row, int column) {
		boolean canEdit = false;
		
		if (column == 0) {
			canEdit = true;
		}
		
		return canEdit;
	}
	
	/*
	 * (non-Javadoc)
	 * @see javax.swing.table.AbstractTableModel#getColumnClass(int)
	 */
	@Override
	public Class<?> getColumnClass(int column) {
		return getValueAt(0, column).getClass();
	}
	
	/**
	 * 
	 * @param row
	 * @return
	 */
	public boolean isChecked(int row) {
		return (Boolean) getValueAt(row, 0);
	}
}
